package com.facebook.android;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.MalformedURLException;

import android.util.Log;

import com.facebook.android.AsyncFacebookRunner.RequestListener;

/**
 * Skeleton base class for RequestListeners, providing default error handling.
 * Applications should handle these error conditions.
 */
public abstract class BaseRequestListener implements RequestListener {
    @Override
    public void onFacebookError(FacebookError fe, final Object state) {
        Log.e("Facebook", fe.getLocalizedMessage(), fe);
    }

    @Override
    public void onFileNotFoundException(FileNotFoundException fnfe, final Object state) {
        Log.e("Facebook", fnfe.getLocalizedMessage(), fnfe);
    }

    @Override
    public void onIOException(IOException ioe, final Object state) {
        Log.e("Facebook", ioe.getLocalizedMessage(), ioe);
    }

    @Override
    public void onMalformedURLException(MalformedURLException mue, final Object state) {
        Log.e("Facebook", mue.getLocalizedMessage(), mue);
    }
}
